<?php

namespace Fwadmin\Controller;

use Think\Controller;

class BaseController extends Controller {

    function _initialize() {
        $is_login = 0;
        $value = cookie('yz_name');
        if ($value) {
            $is_login = 1;
            $this->assign('user_name', $value);
        } else {
            $is_login = 0;
        }
        $map['username'] = array('EQ', $value);
        $manageInfo = M('Manage')->where($map)->find();
        $adminlog = M('Adminlog')->where($map)->order('id desc')->find();
        $adminlog_count = M('Adminlog')->where($map)->count() + 1;
        $this->assign('is_login', $is_login);
        $this->assign('manageInfo', $manageInfo);
        $this->assign('adminlog', $adminlog);
        $this->assign('adminlog_count', $adminlog_count);
    }
    public function ajaxReturn($data) {
        parent::ajaxReturn($data, 'JSON');
    }

}
